<template>
  <div style="height: 100%">
    <div class="about" v-if="HomeNavid == 1">
      <div class="navCss">
        <nav class="nav">{{ selectid == '1-4-2' ? 'AI系统文字对练' : 'AI系统文字测试' }}</nav>
        <div>【功能介绍】</div>
        <p>根据宝马业务需求填写</p>
        <div>【{{ selectid == '1-4-2' ? '对练' : '测试' }}要求】</div>
        <p>根据宝马业务需求填写</p>
      </div>
      <div class="tableHeader">
        <p>项目名称</p>
        <p>操作</p>
      </div>
      <ul class="TableList">
        <li v-for="item in selectData" @click="checkItem(item)" :key="item.key">
          <p>{{ item.name }}</p>
          <p>开始训练</p>
        </li>
      </ul>
    </div>
    <div v-if="HomeNavid == 2" class="about">
      <div class="nav">历史学习与排行榜</div>
    </div>
    <div v-if="HomeNavid == 3" class="about">
      <rootSet v-show="selectid == '3-4-1'" />
      <wsAddDialogue v-show="selectid == '3-4-2'" />
    </div>
  </div>
</template>
<script>
import rootSet from '../components/rootset';
import wsAddDialogue from '../components/WSPAGE/wsAddDialogue';
import { mapState, mapGetters } from 'vuex';
export default {
  name: 'about',
  data() {
    return {};
  },
  methods: {
    checkItem(item) {
      localStorage.setItem('checkItem', JSON.stringify(item));
      console.log(item);

      if (item.name == '客户类型（一）') {
        this.$router.push({
          name: 'Voice',
        });
      }
    },
  },
  computed: {
    // 直接当做普通属性调用不加括号
    // 任何data中数据变化立即重新计算
    // 计算属性会缓存
    ...mapGetters(['selectData']),
    ...mapState(['selectid', 'HomeNavid']),
  },
  components: {
    rootSet,
    wsAddDialogue,
  },
};
</script>
<style lang="less" scoped>
.about {
  box-sizing: border-box;
  padding-top: 8px;
  overflow-x: hidden;
  height: 100%;
}
.txtcentet {
  text-align: center;
}
.nav {
  font-size: 24px;
}
.tableHeader {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  height: 66px;
  justify-content: space-between;
  p {
    min-width: 100px;
    color: #838383;
    font-size: 18px;
  }
}
.TableList {
  display: flex;
  height: 44px;
  line-height: 44px;
  font-size: 16px;
  flex-direction: column;

  li {
    border-bottom: 1px solid #bbbbbb;
    flex: 1;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 5px 10px;
    p {
      min-width: 100px;
      /* .txtcentet(); */

      &:last-of-type {
        color: #5375fe;
        cursor: pointer;
      }
    }
  }
}
.navCss {
  box-sizing: border-box;
  padding: 10px 20px;

  border-bottom: 10px solid #dedede;
  margin: 0 -10px;
}
.navCss div {
  height: 32px;
  line-height: 32px;
  font-size: 18px;
  font-weight: bold;
  box-sizing: border-box;
  padding: 10px;
}
.navCss p {
  padding: 10px;
  color: #7b7c76;
}
</style>
